{include file='comdir/head.html'}
<body>
<div class="content">
	<div class="animated fadeInDown">
		<div class="pos"><a href="#" onClick="javascript :history.back(-1);">返回上一页</a></div>
		<form class="form-horizontal" action="javascript:void(0)" id='frm'>
			<div class="form-group">
				<label class="col-sm-2 control-label">网站名称</label>
				<div class="col-sm-5">
					<input type="text" class="form-control" name="name" value="">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">英文名称</label>
				<div class="col-sm-5">
					<input type="text" class="form-control" name="ename" value="">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">网站域名</label>
				<div class="col-sm-5">
					<input type="text" class="form-control" name="domain" value="">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">网站状态</label>
				<div class="col-sm-5">
					<div class="radio radio-inline">
						<input type="radio" id="status1" name="status" value="1" checked>
						<label for="status1">开启</label>
					</div>
					<div class="radio radio-inline">
						<input type="radio" id="status2" name="status" value="0">
						<label for="status2">关闭</label>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">主网站</label>
				<div class="col-sm-5">
					<div class="radio radio-inline">
						<input type="radio" id="ismain1" name="ismain" value="1" checked>
						<label for="ismain1">是</label>
					</div>
					<div class="radio radio-inline">
						<input type="radio" id="ismain2" name="ismain" value="0">
						<label for="ismain2">否</label>
					</div>
				</div>
			</div>
			<div class="form-group img_show_hide" style="display:none">
				<label class="col-sm-2 control-label">显示图片</label>
				<div class="col-sm-5">
					<img class="show_logo" style="width:100px;height:30px;margin-bottom: 5px;" src="" /><br />
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">上传文件</label>
				<div class="col-sm-5">
					<input type="hidden" value="" name="logo" class="logo">
					<div class="iframe-box btn-blue">
						<iframe id="upiframe" frameborder="0" scrolling="no" src="{$_URL}Ups/upone?method=sites&classname=logo&callback=siteback"></iframe>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">站点描述</label>
				<div class="col-sm-5">
					<input type="text" class="form-control" name="description" value="">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">网站公告</label>
				<div class="col-sm-5">
					<textarea class="form-control" name="explain"></textarea>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-5">
					<input type="button" class="btn btn-block btn-blue sub" name="name" value="提交">
				</div>
			</div>
		</form>
	</div>
</div>
<script type="text/javascript">
var _URL='{$_URL}';
{literal}
function siteback(data){
	if(data.status){
		var classname=data.classname;
		$('.'+classname).val(data.img);
		$('.img_show_hide').show();
		$('.show_'+classname).attr('src',data.imgshow);
	}else{
		layer.msg(data.msg,{icon: 2}, function(){ return false;})
	}
	
}
$(function(){
	$('.sub').click(function(){
		var url=_URL+"Sites/add";
		var formjquery=_ajaxs.from('#frm');
		_ajaxs.post(url,'formjquery='+formjquery,function _result(data){
			ajax_status=true;
			layer.msg(data.msg,{icon: 1}, function(){
				if(data.status){
					window.location.href=_URL+"Sites/lists";
				}
			});
		});
	})
})
{/literal}
</script>
</body>
</html>
